
import unittest
# from base.get_driver import GetDriver
from selenium import webdriver
from .basepage import BasePage


class BaseTest(unittest.TestCase):
    """
    每个用例执行一次setUp、setDown
    """
    def setUp(self):
        self.driver = webdriver.Chrome()
        self.driver.maximize_window()

    def tearDown(self):
        self.driver.quit()


class BaseTestClass(unittest.TestCase):
    """
    用例集整体执行一次setUpClass、tearDownClass
    """
    @classmethod
    def setUpClass(cls):
        # 创建driver
        cls.driver = webdriver.Chrome()
        cls.driver.maximize_window()
        cls.driver.implicitly_wait(90)  # 隐性等待，最长等30秒

    # # 刷新一下当前页面
    # def tearDown(self):
    #     self.driver.refresh()

    @classmethod
    def tearDownClass(cls):
        # 后置：关闭浏览器
        cls.driver.quit()

